var Lottery_Rules = {
		"jsk3hzzx": {
			showname: '和值',
			rulecode: 'jsk3hzzx',
			realname: '[和值_直选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:0,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3hzzx">'
				+ '<dd><h5>和值直选</h5>'
				+'<ul class="sz-qiu"><li id="jsk3hzzx_zu_03">03</li>'
				+'<li id="jsk3hzzx_zu_04">04</li><li id="jsk3hzzx_zu_05">05</li><li id="jsk3hzzx_zu_06">06</li><li id="jsk3hzzx_zu_07">07</li>'
				+'<li id="jsk3hzzx_zu_08">08</li><li id="jsk3hzzx_zu_09">09</li><li id="jsk3hzzx_zu_10">10</li><li id="jsk3hzzx_zu_11">11</li>'
				+'<li id="jsk3hzzx_zu_12">12</li><li id="jsk3hzzx_zu_13">13</li><li id="jsk3hzzx_zu_14">14</li><li id="jsk3hzzx_zu_15">15</li>'
				+'<li id="jsk3hzzx_zu_16">16</li><li id="jsk3hzzx_zu_17">17</li><li id="jsk3hzzx_zu_18">18</li></ul>'
				+'<ul class="gongn"><li datascope="jsk3hzzx_zu_ful_3-18">全</li><li datascope="jsk3hzzx_zu_big_3-18">大</li><li datascope="jsk3hzzx_zu_sma_3-18">小</li>'
				+'<li datascope="jsk3hzzx_zu_sin_3-18">单</li><li datascope="jsk3hzzx_zu_dou_3-18">双</li><li datascope="jsk3hzzx_zu_cle_3-18">清</li></ul></dd></dl>',
			bettips: '从3-18中任意选择1个或1个以上号码，所选号码与开奖号和值相同即中奖.',
			betexample: '如：选择6，开奖号码为321，即为中奖。',
			bethelp: '从3-18中任意选择1个或1个以上号码，所选号码与开奖号和值相同即中奖.',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
					this.startPrice=0;
					way.set('Lottery.prize',(Env.startMoney*way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf")*Env.price/2).toFixed(4));
				} else if (way.get("Lottery.times")) {
					var itemcount = way.get(this.rulecode + ".count.zu");
					var m_balls = way.get(this.rulecode + ".balls.zu");
					var startPrice=0;
					if(itemcount>0){
						for(var i=0;i<m_balls.length;i++){
							if(m_balls[i]){
                                if(startPrice == 0){
                                    startPrice = parseFloat(Env.otherPrize[parseInt(m_balls[i])+'']);
                                }
								var data = parseFloat(Env.otherPrize[parseInt(m_balls[i])+'']);
								if(startPrice > data ){
                                    startPrice = data;
								}
							}
						}
					}
					this.startPrice=startPrice;
					way.set('Lottery.prize',(this.startPrice*way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf")*Env.price).toFixed(4));
					way.set("Lottery.itemcount", ""+itemcount);
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					if (total){
						way.set("Lottery.total", total.toFixed(4));
                    }else{
						way.set("Lottery.total", "0");
                    }
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=3; i <= 18; i++) {
					var item = $("#jsk3hzzx_" + ss[k]+"_" +(i<10?("0"+i):i));
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3sthtx": {
			showname: '三同号',
			rulecode: 'jsk3sthtx',
			realname: '[三同号_通选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:50,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3sthtx">'
				+ '<dd><h5>通选</h5>'
				+'<ul class="sz-qiu"><li id="jsk3sthtx_zu_0">全</li></ul></dd></dl>',
			bettips: '对所有相同的三个号码（111、222、…、666）进行投注。',
			betexample: '如：选择，开奖号码为（111、222、…、666），即为中奖。',
			bethelp: '对所有相同的三个号码（111、222、…、666）进行投注。',
			replaceCode:function(codes){
				codes=codes.replace(new RegExp('0', 'g'),"全");
				return codes;
			},
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var itemcount = way.get(this.rulecode + ".count.zu");

					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=0; i <1; i++) {
					var item = $("#jsk3sthtx_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3sthdx": {
			showname: '三同号',
			rulecode: 'jsk3sthdx',
			realname: '[三同号_单选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:320,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3sthdx">'
				+ '<dd><h5>三同号</h5>'
				+'<ul class="sz-qiu"><li id="jsk3sthdx_zu_111">111</li>'
				+'<li id="jsk3sthdx_zu_222">222</li><li id="jsk3sthdx_zu_333">333</li><li id="jsk3sthdx_zu_444">444</li><li id="jsk3sthdx_zu_555">555</li>'
				+'<li id="jsk3sthdx_zu_666">666</li></ul></dd></dl>',
			bettips: '从所有相同的三个号码（111、222、…、666）中任意选择一组号码进行投注。',
			betexample: '如：选择111，开奖号码为111，即为中奖。',
			bethelp: '从所有相同的三个号码（111、222、…、666）中任意选择一组号码进行投注。',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var itemcount = way.get(this.rulecode + ".count.zu");

					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=111; i <= 666; i=i+111) {
					var item = $("#jsk3sthdx_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3sbthbz": {
			showname: '三不同号',
			rulecode: 'jsk3sbthbz',
			realname: '[三不同号_标准]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:50,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3sbthbz">'
				+ '<dd><h5>标准</h5>'
				+'<ul class="sz-qiu"><li id="jsk3sbthbz_zu_1">1</li>'
				+'<li id="jsk3sbthbz_zu_2">2</li><li id="jsk3sbthbz_zu_3">3</li><li id="jsk3sbthbz_zu_4">4</li><li id="jsk3sbthbz_zu_5">5</li>'
				+'<li id="jsk3sbthbz_zu_6">6</li></ul></dd></dl>',
			bettips: '从1-6中任选3个或者3个以上的号码，所选号码与开奖号码相同即中奖。',
			betexample: '如：选择123，开奖号码为123，即为中奖。',
			bethelp: '从1-6中任选3个或者3个以上的号码，所选号码与开奖号码相同即中奖。',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var zu_count = way.get(this.rulecode + ".count.zu");
					
					var itemcount=0;
					
					if(zu_count>=3){
						
						itemcount=zu_count*(zu_count-1)*(zu_count-2)/(3*2);
						
					}else{
						
						itemcount="0";
					}
					
					
					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=1; i <= 6; i++) {
					var item = $("#jsk3sbthbz_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3sbthdt": {
			showname: '三不同号',
			rulecode: 'jsk3sbthdt',
			realname: '[三不同号_胆拖]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:50,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3sbthdt">'
				+ '<dd><h5>胆码</h5>'
				+'<ul class="sz-qiu"><li id="jsk3sbthdt_d_1">1</li>'
				+'<li id="jsk3sbthdt_d_2">2</li><li id="jsk3sbthdt_d_3">3</li><li id="jsk3sbthdt_d_4">4</li><li id="jsk3sbthdt_d_5">5</li>'
				+'<li id="jsk3sbthdt_d_6">6</li></ul></dd>'
				+ '<dd><h5>拖码</h5>'
				+'<ul class="sz-qiu"><li id="jsk3sbthdt_t_1">1</li>'
				+'<li id="jsk3sbthdt_t_2">2</li><li id="jsk3sbthdt_t_3">3</li><li id="jsk3sbthdt_t_4">4</li><li id="jsk3sbthdt_t_5">5</li>'
				+'<li id="jsk3sbthdt_t_6">6</li></ul></dd></dl>',
			bettips: '从1-6中，选取胆码最多为2个号码，且与拖码组成个数大于或者等于3的投注号码进行投注，选择的胆码必须全部与开奖号码相符才算中奖。',
			betexample: '如：选择2.45或24.135或4.265，开奖号码为245，则这三单都是中奖，若选择23.456则没有中奖，因为选择的胆码3与开奖号码不符。',
			bethelp: '从1-6中，选取胆码最多为2个号码，且与拖码组成个数大于或者等于3的投注号码进行投注，选择的胆码必须全部与开奖号码相符才算中奖。',
			formatBalls : function(balls) {
				return formatBall(balls['d'])+','+formatBall(balls['t']);
			},
			vali: function(e) {
				if (!way.get(this.rulecode + ".count.d")||!way.get(this.rulecode + ".count.t")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var d_count = way.get(this.rulecode + ".count.d");
					var t_count = way.get(this.rulecode + ".count.t");

					var d_balls = way.get(this.rulecode + ".balls.d");
					var t_balls = way.get(this.rulecode + ".balls.t");
					
					if(d_balls&&d_balls.length>0&&t_balls&&t_balls.length>0){
						var isfor=true;
						for(i=0;isfor&&i<d_balls.length;i++)
							if(d_balls[i])
								for(j=0;j<t_balls.length;j++)
									if(t_balls[j]&&t_balls[j]==d_balls[i])
							{
										var ss = e.target.id.split("_");
										var balls = way.get(ss[0] + ".balls." + ss[1]);										
										var count = way.get(ss[0] + ".count." + ss[1]);
										if ($(e.target).hasClass("cur")) {
											$(e.target).removeClass("cur");
											balls[eval(ss[2])] = "";
											way.set(ss[0] + ".count." + ss[1], count - 1);
										} else {
											$(e.target).addClass("cur");
											balls[eval(ss[2])] = ss[2];
											way.set(ss[0] + ".count." + ss[1], count + 1);
										}
										popTips('胆码拖码数字不能相同', "error");
										isfor=false;
										break;
							}
					}

					var itemcount=0;
					var f_flag=false;
					if(d_count>=1&&d_count<=2){
						
						for(var i=0;i<d_balls.length;i++){
							
							if(d_balls[i]!=undefined&&d_balls[i]!=""){
								
								for(var g=0;g<t_balls.length;g++){
									
									if(t_balls[g]!=undefined&&t_balls[g]!=""){
										
										if(parseInt(d_balls[i])==parseInt(t_balls[g])){
											
											f_flag=true;
											break;
											
										}
										
									}
								}
							}
							if(f_flag){
								
								itemcount="0";
								break;
							}
							
						}
					}else{
						
						itemcount="0";

					}
					
					
					if(f_flag==false){
						
						if(d_count==1&&t_count>=2){
							
							itemcount=t_count*(t_count-1)/2;
							
						}else if(d_count==2){
							
							itemcount=t_count;
						}else{
							
							itemcount="0";
						}
					}
					
					
					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["d","t"];
				for(var k=0;k<2;k++)
				for (var i=1; i <= 6; i++) {
					var item = $("#jsk3sbthdt_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3slhtx": {
			showname: '三连号',
			rulecode: 'jsk3slhtx',
			realname: '[三连号_通选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:10,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3slhtx">'
				+ '<dd><h5>通选</h5>'
				+'<ul class="sz-qiu"><li id="jsk3slhtx_zu_0">全</li></ul></dd></dl>',
			bettips: '对所有三个相连的号码（仅限：123、234、345、456）进行投注。',
			betexample: '如：选择123，开奖号码为123，即为中奖。',
			bethelp: '对所有三个相连的号码（仅限：123、234、345、456）进行投注。',
			replaceCode:function(codes){
				codes=codes.replace(new RegExp('0', 'g'),"全");
				return codes;
			},
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var itemcount = way.get(this.rulecode + ".count.zu");

					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=0; i <1; i++) {
					var item = $("#jsk3slhtx_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3slhdx": {
			showname: '三连号',
			rulecode: 'jsk3slhdx',
			realname: '[三连号_单选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:40,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3slhdx">'
				+ '<dd><h5>三连号</h5>'
				+'<ul class="sz-qiu"><li id="jsk3slhdx_zu_123">123</li>'
				+'<li id="jsk3slhdx_zu_234">234</li><li id="jsk3slhdx_zu_345">345</li><li id="jsk3slhdx_zu_456">456</li>'
				+'</ul></dd></dl>',
			bettips: '对三连号选择一个或多个投注',
			betexample: '如：选择123，开奖号码为123，即为中奖。',
			bethelp: '对三连号选择一个或多个投注',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var itemcount = way.get(this.rulecode + ".count.zu");

					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=123; i <= 456; i=i+111) {
					var item = $("#jsk3slhdx_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3ethfx": {
			showname: '二同号',
			rulecode: 'jsk3ethfx',
			realname: '[二同号_复选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:15,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3ethfx">'
				+ '<dd><h5>复选</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ethfx_zu_11">11</li>'
				+'<li id="jsk3ethfx_zu_22">22</li><li id="jsk3ethfx_zu_33">33</li><li id="jsk3ethfx_zu_44">44</li><li id="jsk3ethfx_zu_55">55</li>'
				+'<li id="jsk3ethfx_zu_66">66</li></ul></dd></dl>',
			bettips: '对三个号码中两个指定的相同号码进行投注。(选择范围11-66)',
			betexample: '如：选择11×，开奖号码为112，即为中奖。',
			bethelp: '对三个号码中两个指定的相同号码进行投注。(选择范围11-66)',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var itemcount = way.get(this.rulecode + ".count.zu");

					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=11; i <= 66; i=i+11) {
					var item = $("#jsk3ethfx_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3ethdx": {
			showname: '二同号',
			rulecode: 'jsk3ethdx',
			realname: '[二同号_单选]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			minMode:1850,
			startPrice:100,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3ethdx">'
				+ '<dd><h5>同号</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ethdx_t_11">11</li>'
				+'<li id="jsk3ethdx_t_22">22</li><li id="jsk3ethdx_t_33">33</li><li id="jsk3ethdx_t_44">44</li><li id="jsk3ethdx_t_55">55</li>'
				+'<li id="jsk3ethdx_t_66">66</li></ul></dd>'
				+ '<dd><h5>不同号</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ethdx_b_01">01</li>'
				+'<li id="jsk3ethdx_b_02">02</li><li id="jsk3ethdx_b_03">03</li><li id="jsk3ethdx_b_04">04</li><li id="jsk3ethdx_b_05">05</li>'
				+'<li id="jsk3ethdx_b_06">06</li></ul></dd></dl>',
			bettips: '对三个号码中两个指定的相同号码和一个指定的不同号码进行投注。（分别选择同号和不同号）',
			betexample: '如：选择112，开奖号码为112，即为中奖。',
			bethelp: '对三个号码中两个指定的相同号码和一个指定的不同号码进行投注。（分别选择同号和不同号）',
			formatBalls : function(balls) {
				return formatBall(balls['t'])+','+formatBall(balls['b']);
			},
			vali: function() {
				if (!way.get(this.rulecode + ".count.t")||!way.get(this.rulecode + ".count.b")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var t_balls = way.get(this.rulecode + ".balls.t");
					var b_balls = way.get(this.rulecode + ".balls.b");
					
					var itemcount=0;
					
					var flag=false;
					
					for(var i=0;i<t_balls.length;i++){
						
						if(t_balls[i]!=undefined&&t_balls[i]!=""){
							
							for(var f=0;f<b_balls.length;f++){
								
								if(b_balls[f]!=undefined&&b_balls[f]!=""){
									
									if(parseInt(t_balls[i])==(parseInt(b_balls[f])*10+parseInt(b_balls[f]))){
										
										flag=true;
										break;
										
									}else{
										
										itemcount++;
									}
								}
								
							}
						}
						if(flag){
							
							itemcount="0";
							break;
							
						}
					}
					
					
					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["t","b"];
				
				for(var k=0;k<2;k++){
					
					if(k==0){
						
						for (var i=11; i <= 66; i=i+11) {
							
							var item = $("#jsk3ethdx_" + ss[k]+"_" +i);
							if (item.hasClass("cur")) {
								item.trigger('click');
							} 
						}
						
					}else{
						
						for (var n=1; n <= 6; n++) {
							
							var item = $("#jsk3ethdx_" + ss[k]+"_0" +n);
							if (item.hasClass("cur")) {
								item.trigger('click');
							} 
						}
						
					}
				}
			}
		},"jsk3ebthbz": {
			showname: '二不同号',
			rulecode: 'jsk3ebthbz',
			realname: '[二不同号_标准]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			obtainMaxBetNumberPerOrder:function(currentRecodNumber){
				
				var max_p_n=3;
				
				if(currentRecodNumber>=max_p_n){
					
					return max_p_n;
				}else{
					
					return currentRecodNumber;
				}
				
				
			},
			minMode:1850,
			startPrice:8,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3ebthbz">'
				+ '<dd><h5>标准</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ebthbz_zu_1">1</li>'
				+'<li id="jsk3ebthbz_zu_2">2</li><li id="jsk3ebthbz_zu_3">3</li><li id="jsk3ebthbz_zu_4">4</li><li id="jsk3ebthbz_zu_5">5</li>'
				+'<li id="jsk3ebthbz_zu_6">6</li></ul></dd></dl>',
			bettips: '对三个号码中两个指定的不同号码进行投注。',
			betexample: '如：选择12，开奖号码为123，即为中奖。',
			bethelp: '对三个号码中两个指定的不同号码进行投注。',
			vali: function() {
				if (!way.get(this.rulecode + ".count.zu")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var zu_count = way.get(this.rulecode + ".count.zu");

					var itemcount="0";
					
					if(zu_count>=2){
						
						itemcount=zu_count*(zu_count-1)/2;
					}
					
					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["zu"];
				for(var k=0;k<1;k++)
				for (var i=1; i <= 6; i++) {
					var item = $("#jsk3ebthbz_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		},"jsk3ebthdt": {
			showname: '二不同号',
			rulecode: 'jsk3ebthdt',
			realname: '[二不同号_胆拖]',
			maxMultiplePerOrder:-1,
			maxPrize:-1,
			maxRecord:-1,
			obtainMaxBetNumberPerOrder:function(currentRecodNumber){
				
				var max_p_n=2;
				
				if(currentRecodNumber>=max_p_n){
					
					return max_p_n;
				}else{
					
					return currentRecodNumber;
				}
				
				
			},
			minMode:1850,
			startPrice:8,
			calculatePrize:Env.defaultCalculate,
			pageHtml:'<dl class="danqiu" id="jsk3ebthdt">'
				+ '<dd><h5>胆码</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ebthdt_d_1">1</li>'
				+'<li id="jsk3ebthdt_d_2">2</li><li id="jsk3ebthdt_d_3">3</li><li id="jsk3ebthdt_d_4">4</li><li id="jsk3ebthdt_d_5">5</li>'
				+'<li id="jsk3ebthdt_d_6">6</li></ul></dd>'
				+ '<dd><h5>拖码</h5>'
				+'<ul class="sz-qiu"><li id="jsk3ebthdt_t_1">1</li>'
				+'<li id="jsk3ebthdt_t_2">2</li><li id="jsk3ebthdt_t_3">3</li><li id="jsk3ebthdt_t_4">4</li><li id="jsk3ebthdt_t_5">5</li>'
				+'<li id="jsk3ebthdt_t_6">6</li></ul></dd></dl>',
			bettips: '从1-6中，选取2个及以上的号码进行投注，每注需至少包括1个胆码及1个拖码。',
			betexample: '如：选择12，开奖号码为123，即为中奖。',
			bethelp: '从1-6中，选取2个及以上的号码进行投注，每注需至少包括1个胆码及1个拖码。',
			formatBalls : function(balls) {
				return formatBall(balls['d'])+','+formatBall(balls['t']);
			},
			vali: function(e) {
				if (!way.get(this.rulecode + ".count.d")||!way.get(this.rulecode + ".count.t")) {
					way.set("Lottery.itemcount", "0");
					way.set("Lottery.total", "0");
				} else if (way.get("Lottery.times")) {
					
					var d_balls = way.get(this.rulecode + ".balls.d");
					var d_count = way.get(this.rulecode + ".count.d");

					var t_balls = way.get(this.rulecode + ".balls.t");
					
					if(d_balls&&d_balls.length>0&&t_balls&&t_balls.length>0){
						var isfor=true;
						for(i=0;isfor&&i<d_balls.length;i++)
							if(d_balls[i])
								for(j=0;j<t_balls.length;j++)
									if(t_balls[j]&&t_balls[j]==d_balls[i])
							{
										var ss = e.target.id.split("_");
										var balls = way.get(ss[0] + ".balls." + ss[1]);										
										var count = way.get(ss[0] + ".count." + ss[1]);
										if ($(e.target).hasClass("cur")) {
											$(e.target).removeClass("cur");
											balls[eval(ss[2])] = "";
											way.set(ss[0] + ".count." + ss[1], count - 1);
										} else {
											$(e.target).addClass("cur");
											balls[eval(ss[2])] = ss[2];
											way.set(ss[0] + ".count." + ss[1], count + 1);
										}
										popTips('胆码拖码数字不能相同', "error");
										isfor=false;
										break;
							}
					}
					
					var itemcount=0;
					
					var f_flag=false;
					
					if(d_count==1){
						
						for(var i=0;i<d_balls.length;i++){
							
							if(d_balls[i]!=undefined&&d_balls[i]!=""){
								
								for(var g=0;g<t_balls.length;g++){
									
									if(t_balls[g]!=undefined&&t_balls[g]!=""){
										
										if(parseInt(d_balls[i])!=parseInt(t_balls[g])){
											
											itemcount++;
											
										}else{
											
											f_flag=true;
											break;
										}
									}
								}
							}
							if(f_flag){
								
								itemcount="0";
								break;
								
							}
						}
					}else{
						
						itemcount="0";

					}
					
					way.set("Lottery.itemcount", ""+itemcount);
					
					var total = itemcount * way.get("Lottery.times") * way.get("http://www.yugj881.com/resources/main/lottery/Lottery.yjf") * Env.price;
					
					if (total)
						way.set("Lottery.total", total.toFixed(4));
					else way.set("Lottery.total", "0");
				} else {
					way.set("Lottery.total", "0");
				}
			},
			clear:function(){
				var ss=["d","t"];
				for(var k=0;k<2;k++)
				for (var i=1; i <= 6; i++) {
					var item = $("#jsk3ebthdt_" + ss[k]+"_" +i);
					if (item.hasClass("cur")) {
						item.trigger('click');
					} 
				}
			}
		}
};

